import request from "@/utils/request";

export function page(data) {
  return request({
    url: "/v1/group/page",
    method: "get",
    params: data
  });
}

export function list() {
  return request({
    url: "/v1/group/list",
    method: "get"
  });
}

export function save(data) {
  return request({
    url: "/v1/group/save",
    method: "post",
    data: data
  });
}

export function update(data) {
  return request({
    url: "/v1/group/update",
    method: "post",
    data: data
  });
}

export function deleteById(id) {
  return request({
    url: "/v1/group/delete/" + id,
    method: "get"
  });
}

export function getById(id) {
  return request({
    url: "/v1/group/get/" + id,
    method: "get"
  });
}

export function saveBatch(data) {
  return request({
    url: "/v1/group-device/saveBatch",
    method: "POST",
    params: data
  });
}

export function unbind(data) {
  return request({
    url: "/v1/group-device/unbind",
    method: "get",
    params: data
  });
}

// 根据分组ID查询可绑定设备
export function pageByGroupId(data) {
  return request({
    url: "/v1/group-device/pageByGroupId",
    method: "get",
    params: data
  });
}
